package com.easydata.libPlugin.core;

import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.easydata.libPlugin.core.interfaces.IEventListener;

public abstract class AbstractEventListener implements IEventListener {

    protected AbstractEventListener() {

    }

    protected void onProduced(AbstractNode sender, JSONArray data) {
    }

    protected void onDone(AbstractNode sender) {
    }

    protected void onException(AbstractNode sender, Exception ex) {

    }

    protected void onPrepared(AbstractNode sender, JSONObject parameter) {
    }

    protected void onStarted(AbstractNode sender) {
    }

    protected void onProcessed(AbstractNode sender, JSONArray data) {
    }

    protected void onStopped(AbstractNode sender) {
    }

    /// true: pass the message
    /// false: skip the message
    protected boolean onMessage(AbstractNode sender, Message msg) {
        return true;
    }

}
